//
//  MAMineTableViewCell.m
//  MateAdv
//
//  Created by 茶 on 2023/9/15.
//

#import "MAMineTableViewCell.h"

@interface MAMineTableViewCell ()

@property (nonatomic, strong) UIImageView *logoView;
@property (nonatomic, strong) UILabel *titleLabel;

@end


@implementation MAMineTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initInterface];
    }
    return self;
}

- (void)initInterface {
    _logoView = [UIImageView new];
    [self.contentView addSubview:_logoView];
    [_logoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.ma_offset(21);
        make.centerY.mas_equalTo(0);
        make.size.ma_offset(20);
    }];
    
    _titleLabel = [UILabel ma_labelWithSuperView:self.contentView text:@"" textFont:MAFontScaleRegular(16) textColor:MAColor(@"#333333") textAlignment:0 makeMasonryBlock:^(MASConstraintMaker * _Nonnull make) {
        make.left.ma_offset(60);
        make.centerY.mas_equalTo(0);
    }];
    
    [UIImageView ma_imgViewWithSuperView:self.contentView imgName:@"Mine_Arrow" makeMasonryBlock:^(MASConstraintMaker * _Nonnull make) {
        make.centerY.mas_equalTo(0);
        make.right.ma_offset(-19);
    }];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setTitle:(NSString *)title {
    _title = title;
    _titleLabel.text = title;
}

- (void)setImgName:(NSString *)imgName {
    _imgName = imgName;
    [_logoView setImage:[UIImage imageNamed:imgName]];
//    [self.contentView layoutIfNeeded];
}

@end
